<?php

namespace App\Model\System;

use App\Model\Model;
use Hyperf\Database\Model\SoftDeletes;

/**
 * @property integer $id
 * @property integer $city_id
 * @property integer $level
 * @property integer $parent_id
 * @property string $area_code
 * @property string $name
 * @property string $merger_name
 * @property string $lng
 * @property string $lat
 * @property boolean $is_show
 */
class SystemCity extends Model
{
    use SoftDeletes;

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'system_city';

    protected $fillable = [
        'city_id',
        'level',
        'parent_id',
        'area_code',
        'name',
        'merger_name',
        'lng',
        'lat',
        'is_show',
    ];

    public function Children()
    {
        return $this->HasMany(SystemCity::class, 'parent_id', 'city_id');
    }
}
